The Command Panel
Figure 1-1 shows the Command panel of JBindery. This is the default panel that appears when you launch JBindery.
![]()
The Command panel determines the Java class to execute, the parameters to pass to the class's main method, and the locations to direct console input or output.
Along the bottom of the panel there are three buttons you use to control JBindery actions. These buttons appear on every panel.
- The Class Name field should contain the name of the class you want to execute. This name should have the form
package.package.classname
without a.class
extension. If desired, you can specify a slash (/
) instead of the period (.
) as a delimiter.The class you specify must contain a method with one of the following declarations:
public static void main (String args[])
public static void main()
If you launch JBindery by dragging a class file onto the JBindery icon, the selected class name automatically appears in the Class Name field.
- The Optional Parameters field lets you specify text parameters to pass to the main method. JBindery makes assumptions based on the parameters as follows:
- If no parameters are specified, JBindery attempts to execute the
main()
method with no arguments. If nomain()
method is found in the class, JBindery creates a zero-length string array and calls themain (String args[])
method.- If you specify parameters, JBindery attempts to execute the
main (String args[])
method. If nomain (String args[])
method exists in the class, then JBindery calls themain()
method with no parameters.- If JBindery cannot find any
main
method, it throws an exception.JBindery considers spaces, tabs, and carriage returns as parameter delimiters. If you want to include such characters as part of a parameter, you must enclose the string in quotation marks (
" "
).If you want to include quotation marks in your parameter, you must precede each instance with a backslash (
\
). For example, you would specify the stringHe said, "Hi"
as"He said, \"Hi\""
.To specify Unicode strings, you should precede the Unicode value with
\x
.
- The Redirect Stdout pop-up menu lets you redirect any console output (that is, any output that the Java application writes to
System.out
orSystem.err
). Selecting the pop-up menu displays the following options:
- Message Window: Console output appears in a plain text window.
- Nowhere: Console output is ignored.
- To File...: Console output is sent to a new file, overwriting an existing file if necessary. Selecting this option brings up a save dialog box that allows you to specify the name and location of the output file.
- Append File...: Console output is appended to an existing file (or a new one if it does not currently exist). Selecting this option brings up a dialog box that allows you to specify the name and location of the output file.
- The Redirect Stdin pop-up menu specifies the source of any console input (that is, any input that comes from
System.In
). Selecting the pop-up menu displays the following options:
- Nowhere: No input is taken.
- Message Window: The user is prompted to enter text in a plain text window. This is the same window that displays console output.
- From File: The specified file is treated as the input source. Selecting this option brings up a dialog box that allows you to specify the name and location of the input file.
- The Save Settings button brings up a save dialog box. You use this button to save your application settings as a settings file or as part of a packaged application.
- The Quit button quits JBindery. Any unsaved settings are lost.
- The Run button executes your Java application with the specified settings.